#ifndef _STEPMOTOR_H
#define _STEPMOTOR_H
#include <zephyr/drivers/pwm.h>

typedef struct __attribute__ ((__packed__)){
    float dist;
}Stepmotor_Ctr;

typedef struct __attribute__ ((__packed__))s{
    float dist;
}Stepmotor_Sta;

int Stepmotor_init(void);
void stepmotor_timer_function(struct k_timer *timer_id);
int Stepmotor_ctr_API(Stepmotor_Ctr Stepmotor_Ctr_val);

#define  STEPMOTOR    (const struct pwm_dt_spec) PWM_DT_SPEC_GET(DT_ALIAS(stepmotor))
#define  STEPMOTOR_PERIOD                      PWM_USEC(625/2)
#define  STEPMOTOR_PULSE                   STEPMOTOR_PERIOD - PWM_USEC(10U)
#define stepping_motor_maxdist 14

#endif